
# 在干嘛啊 大哥！ -3
def Initialise():
    for j in range(100):
        NumberOfJobs[j][0] = -1
        NumberOfJobs[j][1] = -1
        NumberOfJobs[j][0] = 0


def AddJob(jobnumber,priority):
    flag = False
    for i in range(100):
        if NumberOfJobs[i][0] == 0 and NumberOfJobs[i][1] == -1:
            NumberOfJobs[i][0] = jobnumber
            NumberOfJobs[i][1] = priority
            flag = True
        if flag == True:
            print("successfully")
            break
    if flag == False:
        print("not successfully")


def InsertionSort():#insert sort 忘了, 感觉这个还跟咱们写的改变了一些
    i = 1
    j = i - 1
    key = NumberOfJobs[j][1]
    while j != -1 and key > NumberOfJobs[i][1]:
        if NumberOfJobs[i][1] == -1:
            break
        NumberOfJobs[j][1] = NumberOfJobs[i][1]
        j = i
        i += 1
    j -= 1
    NumberOfJobs[j][1] = key



def PrintArray():
    for i in range(100):
        if NumberOfJobs[i][0] != -1 and NumberOfJobs[i][1] != -1:
            print(f"{NumberOfJobs[i][0]} priority {NumberOfJobs[i][1]}")


if __name__ == '__main__':
    NumberOfJobs = [[None for i in range(2)] for j in range(100)]  # integer 名字不对吧 -2


    Initialise()
    AddJob(12,10)
    AddJob(526,9)
    AddJob(33,8)
    AddJob(12,9)
    AddJob(78,1)
    InsertionSort()
    PrintArray()
